from django.contrib import admin
from myApp.models import JobInfo,User,History

class JobManager(admin.ModelAdmin):
    # 页面展示字段
    list_display = ['id','title','type','workExperience','educational','salary','salaryMonth','workTag','createTime','detailUrl','dist','companyTitle','companyUrl','companyAvatar','companyNature','companyPeople','companyStatus','companyTags','address','hrName','hrWork']
    # 页面展示字段链接
    list_display_links = ['title']
    # 页面过滤字段
    list_filter = ['type']
    # 页面搜索字段
    search_fields = ['title']
    # 只读字段
    readonly_fields = ['id']
    # 每页显示多少条数据
    list_per_page = 20
    # 时间字段
    date_hierarchy = 'createTime'

class UserManager(admin.ModelAdmin):
    list_display = ['id','username','password','work','workExperience','educational','address','createTime']
    list_filter = ['username']
    search_fields = ['username']
    readonly_fields = ['id']
    list_per_page = 20
    date_hierarchy = 'createTime'

class HistoryManager(admin.ModelAdmin):
    list_display = ['id','user','job','count']

admin.site.register(JobInfo,JobManager)
admin.site.register(User,UserManager)
admin.site.register(History,HistoryManager)